package cn.beyond.vehicleManagement.dao;

import cn.beyond.vehicleManagement.pojo.SysUser;
import cn.beyond.vehicleManagement.util.DataBaseUtil;

import java.util.List;
import java.util.Map;

public class UserDao extends DataBaseUtil {
       DataBaseUtil<SysUser>userDao=new DataBaseUtil<>();

    /**
     * 添加用户
     * @param user
     * @return
     */
       public int addUser(SysUser user){
        return    userDao.addUtil(user,"sys_user");
     }

    /**
     * 删除用户
     * @param obj
     * @param column
     * @return
     */
     public int deleteUser(Object obj,String column){
           return userDao.delByIdUtil(obj,"sys_user",column);

     }

    /**
     * 修改用户
     * @param user
     * @return
     */
     public int update(SysUser user){
         return  userDao.updateByidUtil(user,"sys_user");
     }

    /**
     * 查询结果返回单条记录
     * @param user
     * @param selectmap
     * @return
     */
     public SysUser selectUserByOne(SysUser user, Map<String, Object> selectmap){
        return userDao.selectONE(user,"sys_user",selectmap);
     }

    /**
     * 查询结果返回多条记录
     * @param user
     * @param selectmap
     * @return
     */
     public List<SysUser> selectUserByCondition(SysUser user, Map<String, Object> selectmap){
       return  userDao.selectAll(user,"sys_user",selectmap);
     }
}
